<?php

class JqGridFilterToolbar extends CComponent {

    protected $grid;
    /**
     * @var bolean
     */
    public $autosearch = true;
    /**
     * @var bolean
     */
    public $searchOnEnter = true;
    /**
     * @var bolean
     */
    public $stringResult = false;


    /**
     * Constructor.
     * @param CGridView the grid view that owns this column.
     */
    public function __construct($grid) {
        $this->grid = $grid;
    }

    public function registerClientScript() {
        foreach(get_object_vars($this) as $key=>$value){
            if($key == 'grid')continue;
            $options[$key] = $this->$key;
        }
        $options = CJavaScript::encode($options);
        Yii::app()->getClientScript()->registerScript(__CLASS__ . '#' . $pager_id, "jQuery('#".$this->grid->getId()."').jqGrid('filterToolbar', $options);");
    }

}
